﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Globalization;
using System.Linq;
using System.Text;

namespace ModernUILogViewer.Settings
{
    class RegexSettings : ApplicationSettingsBase
    {
        [UserScopedSettingAttribute()]
        [DefaultSettingValue(@"^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}")]
        public string LineBeginningRegExp
        {
            get { return (string)(this["LineBeginningRegExp"]); }
            set { this["LineBeginningRegExp"] = value; }
        }

        [UserScopedSettingAttribute()]
        [DefaultSettingValue(@"^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}")]
        public string DateRegExp
        {
            get { return (string)(this["DateRegExp"]); }
            set { this["DateRegExp"] = value; }
        }

        [UserScopedSettingAttribute()]
        [DefaultSettingValue("yyyy-MM-dd HH:mm:ss")]
        public string DateFormat
        {
            get { return (string)(this["DateFormat"]); }
            set { this["DateFormat"] = value; }
        }

        [UserScopedSettingAttribute()]
        [DefaultSettingValue(@"(DEBUG|INFO|WARN|ERROR|FATAL).*\s\-\s")]
        public string LevelRegExp
        {
            get { return (string)(this["LevelRegExp"]); }
            set { this["LevelRegExp"] = value; }
        }

        [UserScopedSettingAttribute()]
        [DefaultSettingValue("1")]
        public int LevelGroupMatch
        {
            get { return (int)(this["LevelGroupMatch"]); }
            set { this["LevelGroupMatch"] = value; }
        }

        [UserScopedSettingAttribute()]
        [DefaultSettingValue("0")]
        public int DateGroupMatch
        {
            get { return (int)(this["DateGroupMatch"]); }
            set { this["DateGroupMatch"] = value; }
        }

        [UserScopedSettingAttribute()]
        [DefaultSettingValue("true")]
        public bool IncludeDateMatch
        {
            get { return (bool)(this["IncludeDateMatch"]); }
            set { this["IncludeDateMatch"] = value; }
        }

        [UserScopedSettingAttribute()]
        [DefaultSettingValue("true")]
        public bool IncludeLevelMatch
        {
            get { return (bool)(this["IncludeLevelMatch"]); }
            set { this["IncludeLevelMatch"] = value; }
        }

        [UserScopedSettingAttribute()]        
        [DefaultSettingValue("en-US")]
        public CultureInfo SelectedCultureInfo
        {
            get { return (CultureInfo)(this["SelectedCultureInfo"]); }
            set { this["SelectedCultureInfo"] = value; }
        }
    }
}
